import cookies from 'react-cookies'

const TOKEN = 'adminToken';
const USERNAME = 'username'
// 存储cookies
export function setToken(token) {
    cookies.save(TOKEN, token)
}

// 存储用户名
export function setUsername(username) {
    cookies.save(USERNAME, username)
}

// 获取cookies
export function getToken() {
    return cookies.load(TOKEN)
}

// 获取用户名
export function getUsername() {
    return cookies.load(USERNAME)
}